/* textstream - a library for rendering scrolling text
 * Copyright (C) 2011 Jack Kelly <jack@jackkelly.name>
 *
 * This library is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation, either version 3 of
 * the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef TEXTSTREAM_EVENT_H
#define TEXTSTREAM_EVENT_H

#include <glib.h>
#include <fake437.h>

enum textstream_event_type {
  TEXTSTREAM_EVENT_TEXT,
  TEXTSTREAM_EVENT_FG,
  TEXTSTREAM_EVENT_BG,
  TEXTSTREAM_EVENT_NEWLINE
};

struct textstream_text_event {
  guint i;
  gboolean instant;
  gchar* str;
};

struct textstream_event {
  enum textstream_event_type type;
  union {
    struct textstream_text_event text;
    F437Color fg;
    F437Color bg;
    guint speed;
  };
};

struct textstream_event* textstream_text_event_new(const gchar* str,
                                                   gboolean instant);
struct textstream_event* textstream_fg_event_new(F437Color fg);
struct textstream_event* textstream_bg_event_new(F437Color bg);
struct textstream_event* textstream_newline_event_new(void);
void textstream_event_free(struct textstream_event* ev);

#endif
